<!DOCTYPE html>
<!--
                                   ,343                                    
                               .69##962                                    
  .,355666541     ,4554441.     3#@73.15444531   15444541.5555555444455553,
 ,8##@66458@#@63.  18###76     ,@962  .5###861    5###@72 6#@876###877@##83
  2##74    19##63    3##@63   3#95,    1###95,    8###74   451  7##62  364 
  2##74    3##@72     ,9##85,5#84.     2@7##85.  6#8##84    .   7##72   .  
268##@8778@##84,        6##9@@72       2#69##64 3#68##84        7##72      
136##8544458##841        5##961        2#629#@54#843##84        7##72      
  2##75     4###71       2##86         2#6,1##8@96.3##84        7##72      
  1##74     5##961       2##86         3#71 5##@62 3##74        6##62      
 ,7##9844569#@863       28###94.     .4@#@6, 9#74 28##@81     .3@##@6.     
 26555566666431,       155555565     4655556..54  36555573    .5555566,     

-->
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>cocos2dx适配方案新解——秒杀所有分辨率|皂荚花</title>
<meta name="description" content="我看了网上一些人的文章，写的模模糊糊的，以至于让我搞了俩个晚上，所以赶紧写下这篇文章，和大家分享。这个方案我会跟大家一块来测试，实现标题说的那样。我将循序渐进的讲明白这个问题，不信你比我还笨！" />
<meta name="keywords" content="适配" />
<link rel="profile" href="http://gmpg.org/xfn/11" />
<link rel="pingback" href="http://www.zaojiahua.com/xmlrpc.php" />
<link rel="shortcut icon" href="http://www.zaojiahua.com/wp-content/uploads/2014/03/Icon1.png" type="image/x-icon" />
<link rel="icon" href="http://www.zaojiahua.com/wp-content/uploads/2014/03/Icon1.png" type="image/x-icon" />
<link rel="stylesheet" type="text/css" href="http://www.zaojiahua.com/wp-content/themes/BYMT/style.css" media="all" />
<!--[if IE 7]><link rel="stylesheet" href="http://www.zaojiahua.com/wp-content/themes/BYMT/css/ie7.css" type="text/css" /><![endif]-->
<!--[if IE 8]><link rel="stylesheet" href="http://www.zaojiahua.com/wp-content/themes/BYMT/css/ie8.css" type="text/css" /><![endif]-->
<!--[if lt IE 9]>
	<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
	<script src="http://www.zaojiahua.com/wp-content/themes/BYMT/js/respond.min.js"></script>
<![endif]-->
<link rel="alternate" type="application/rss+xml" title="皂荚花 &raquo; Feed" href="http://www.zaojiahua.com/feed" />
<link rel="alternate" type="application/rss+xml" title="皂荚花 &raquo; 评论Feed" href="http://www.zaojiahua.com/comments/feed" />
<link rel="alternate" type="application/rss+xml" title="皂荚花 &raquo; cocos2dx适配方案新解——秒杀所有分辨率评论Feed" href="http://www.zaojiahua.com/adaptation.html/feed" />
<script type="text/javascript">
var duoshuoQuery = {"short_name":"zaojiahua","sso":{"login":"http:\/\/www.zaojiahua.com\/wp-login.php?action=duoshuo_login","logout":"http:\/\/www.zaojiahua.com\/wp-login.php?action=logout&_wpnonce=eae75acf00"},"theme":"default","stylePatch":"wordpress\/BYMT"};
duoshuoQuery.sso.login += '&redirect_to=' + encodeURIComponent(window.location.href);
duoshuoQuery.sso.logout += '&redirect_to=' + encodeURIComponent(window.location.href);
</script>
<script type="text/javascript" src="http://static.duoshuo.com/embed.js" charset="UTF-8" async="async"></script>
<script type='text/javascript' src='http://www.zaojiahua.com/wp-includes/js/jquery/jquery.js?ver=1.11.0'></script>
<script type='text/javascript' src='http://www.zaojiahua.com/wp-includes/js/jquery/jquery-migrate.min.js?ver=1.2.1'></script>
<style type="text/css" id="syntaxhighlighteranchor"></style>
</head>
<body class="single single-post postid-630 single-format-standard">
<div id="wrapper-innerIE6"></div>
<div id="wrapper">
<div id="wrapper-inner" data-bymts="theme-bymt mouse-title ajax-comment ajax-search">
<div id="header" class="container">
	<div id="header-inner">
	<div id="logo">
			<h1><a title="皂荚花" href="http://www.zaojiahua.com/" rel="index">皂荚花 cocos2d-x技术实战</a></h1>
				<p class="logodesc">
			感谢大家来访，请关注皂荚花！关注小塔博客！		</p>
				</div>
	<div id="topblock">
				<i>
		欢迎来自www.baidu.com的盆友！		</i>
			</div>
	</div>
	<div class="line"></div>
    <div id="mobile-nav">
    <a href="#main-nav"><i class="icon-menu"></i> Menu</a>
    </div>
	<div id="main-nav">
		<div id="nav-menu"><ul><li id="menu-item-61" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-home menu-item-61"><a title="皂荚花" href="http://www.zaojiahua.com/">首页</a></li>
<li id="menu-item-6" class="menu-item menu-item-type-taxonomy menu-item-object-category current-post-ancestor current-menu-parent current-post-parent menu-item-6"><a title="cocos2d-x基础" href="http://www.zaojiahua.com/category/cocos2d-x">cocos2d-x基础</a></li>
<li id="menu-item-7" class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-7"><a title="cocos2d-x项目实战" href="http://www.zaojiahua.com/category/cocos2d-xdemo">cocos2d-x项目实战</a></li>
<li id="menu-item-712" class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-has-children menu-item-712"><a title="c、c++等编程语言" href="http://www.zaojiahua.com/category/other-programer">编程语言</a>
<ul class="sub-menu">
	<li id="menu-item-713" class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-713"><a title="c与c++" href="http://www.zaojiahua.com/category/c">c/c++</a></li>
	<li id="menu-item-980" class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-980"><a title="java语言" href="http://www.zaojiahua.com/category/java">java</a></li>
	<li id="menu-item-714" class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-714"><a title="数据结构" href="http://www.zaojiahua.com/category/suanfa">数据结构与算法</a></li>
</ul>
</li>
<li id="menu-item-946" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-has-children menu-item-946"><a href="#">休闲一刻</a>
<ul class="sub-menu">
	<li id="menu-item-947" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-947"><a title="老盯着屏幕不累啊，放松一下吧！" href="http://www.zaojiahua.com/music">听听音乐</a></li>
	<li id="menu-item-950" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-950"><a title="留下你宝贵的墨迹吧！" href="http://www.zaojiahua.com/leave-me-a-message">给我留言</a></li>
</ul>
</li>
<li id="menu-item-715" class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-has-children menu-item-715"><a title="资源下载和交易" href="http://www.zaojiahua.com/category/other">其他资源</a>
<ul class="sub-menu">
	<li id="menu-item-717" class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-has-children menu-item-717"><a title="资源下载" href="http://www.zaojiahua.com/category/download">下载专区</a>
	<ul class="sub-menu">
		<li id="menu-item-718" class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-718"><a href="http://www.zaojiahua.com/category/software-download">常用软件下载</a></li>
		<li id="menu-item-719" class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-719"><a href="http://www.zaojiahua.com/category/book-download">电子书籍下载</a></li>
		<li id="menu-item-720" class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-720"><a href="http://www.zaojiahua.com/category/video-download">视频下载</a></li>
	</ul>
</li>
	<li id="menu-item-716" class="menu-item menu-item-type-taxonomy menu-item-object-category menu-item-716"><a title="资源交易" href="http://www.zaojiahua.com/category/business">交易</a></li>
</ul>
</li>
</ul></div>				<div id="nav-search">
			<form action="http://www.zaojiahua.com/" method="get">
				<input type="text" name="s" id="search-input" data-searchtips="搜点什么呢..." value="" autocomplete="off" x-webkit-speech x-webkit-grammar="builtin:translate" />
				<ul id="search-cloud" data-cloudnum="5">
				</ul>
				<input type="submit" value="搜索" />
			</form>
		</div>
			</div>
</div>
<div id="topbar" class="container">
<div id="bulletin">
	<i class="icon-sound"></i> 程序不是看出来的，是写出来的！思想不是想出来的，是敲出来的！欢迎加本人QQ:2933682586与我探讨技术问题！</div>
<div id="rss">
	<ul>
												<li><a href="http://weibo.com/dengta2014/home?topnav=1&#038;wvr=5" rel="external" target="_blank" class="icons-wb" title="我的新浪微博"></a></li>
						<li><a href="http://www.zaojiahua.com/feed" rel="external" target="_blank" class="icons-rss" title="RSS订阅"></a></li>
		        		<li><a href="http://list.qq.com/cgi-bin/qf_invite?id=f1c58b60e0b3bde6bb9b8280b0ad3d34d3219cb2a613aacc" rel="external" target="_blank" class="icons-em" title="邮件订阅"></a></li>
					</ul>
</div>
</div>
<div id="content-wrap">
	<div id="content-main">
				<div class="post-single">
						<div class="post-header">
				<h2 class="post-title">cocos2dx适配方案新解——秒杀所有分辨率</h2>
			</div>
			<div class="post-meta">
							<ul class="resizer">
					<li id="f_s"><a href="javascript:;" title="缩小字体">小</a></li>
					<li id="f_m"><a href="javascript:;" title="默认字体">中</a></li>
					<li id="f_l"><a href="javascript:;" title="加大字体">大</a></li>
					<li id="f_c"><a href="javascript:;" title="关闭侧边栏"><i class="icon-stop"></i></a></li>					<li id="f_o"><a href="javascript:;" title="打开侧边栏"><i class="icon-pause"></i></a></li>				</ul>
								<span class="pauthor"><i class="icon-user-add"></i><a href="http://www.zaojiahua.com/author/admin" title="由小塔发布" rel="author">小塔</a></span>
				<span class="ptime"><i class="icon-calendar"></i>2014-03-05 22:07</span>
				<span class="pcate"><i class="icon-category"></i><a href="http://www.zaojiahua.com/category/cocos2d-x" title="查看cocos2d-x基础中的全部文章" rel="category tag">cocos2d-x基础</a></span>
				<span class="pview"><i class="icon-pass"></i>热度:2,378</span>				<span class="pcomm"><i class="icon-chat"></i><a href="http://www.zaojiahua.com/adaptation.html#comments" rel="nofollow" class="ds-thread-count" data-thread-key="630" title="《cocos2dx适配方案新解——秒杀所有分辨率》上的评论">28条评论</a></span>
							</div>
								<div class="post-content">
					<p><span style="font-family: arial, helvetica, sans-serif; font-size: large;">       这几天写好了忍者飞镖的小例子，移植到android平台上一看，小了不少。于是才想到了分辨率的问题，接着就研究了俩个晚上的分辨率，今天终于搞定了。我看了网上一些人的文章，写的模模糊糊的，以至于让我搞了俩个晚上，所以赶紧写下这篇文章，和大家分享。这个方案我会跟大家一块来测试，实现标题说的那样。我将循序渐进的讲明白这个问题，不信你比我还笨！</span></p>
<p><span style="font-family: arial, helvetica, sans-serif; font-size: large;">首先建立一个最原始的工程，运行起来看的话一切正常！<strong>接着我们来调节一下设备的实际分辨率大小，这个是在main.cpp中的 eglView-&gt;setFrameSize(480, 320)这句话，里边的两个参数就是宽和高了。</strong>我们改成(800,480)和(960,640)，运行起程序来看一下。</span></p>
<p style="text-align: center;"><a href="http://www.zaojiahua.com/wp-content/uploads/2014/03/2014-03-05_200745.jpg"><img class="size-medium wp-image-633 aligncenter" title="cocos2dx适配方案新解——秒杀所有分辨率" alt="cocos2dx适配方案新解——秒杀所有分辨率" src="http://www.zaojiahua.com/wp-content/uploads/2014/03/2014-03-05_200745-300x191.jpg" data-original="http://www.zaojiahua.com/wp-content/uploads/2014/03/2014-03-05_200745-300x191.jpg" onerror="this.onerror=null;this.src='http://www.zaojiahua.com/wp-content/themes/BYMT/images/images_error.jpg'" width="300" height="191" /></a> <a href="http://www.zaojiahua.com/wp-content/uploads/2014/03/2014-03-05_200820.jpg"><img class="size-medium wp-image-634 aligncenter" title="cocos2dx适配方案新解——秒杀所有分辨率" alt="cocos2dx适配方案新解——秒杀所有分辨率" src="http://www.zaojiahua.com/wp-content/uploads/2014/03/2014-03-05_200820-300x208.jpg" data-original="http://www.zaojiahua.com/wp-content/uploads/2014/03/2014-03-05_200820-300x208.jpg" onerror="this.onerror=null;this.src='http://www.zaojiahua.com/wp-content/themes/BYMT/images/images_error.jpg'" width="300" height="208" /></a></p>
<p style="text-align: left;"><span style="font-family: arial, helvetica, sans-serif; font-size: large;">你看到的应该就是如图所示的样子，因为我们的资源背景图片大小是480*320，当我们的设备改变的时候它在设备上显示的也就是原始的这个尺寸，不会进行放大和缩小的，显然不能满足我们的要求，那我们就通过一个函数调用来让它随着分辨率放到和缩小吧。<strong>设置的方法是在AppDelegate的bool AppDelegate::applicationDidFinishLaunching() 函数中在还没有运行场景的时候添加如下的代码pEGLView-&gt;setDesignResolutionSize(float width, float height, ResolutionPolicy resolutionPolicy)，这个函数有三个参数。</strong>这三个参数都很重要，第一个参数和第二个参数是设计分辨率，这个分辨率就是我们写代码的时候参考的分辨率，我们程序中设置精灵的坐标时候用到的也应该是这俩个参数，因为我们在实际的写游戏项目的时候都不会写成死的坐标，而是一种相对的位置，比如我们经常通过getWinSize()获得屏幕的分辨率，然后设置精灵的位置在它的几分之几处，而这俩个参数就是我们将要用到的参数。<strong>第三个参数有几种情况，它们的意思如下：</strong></span></p>
<p><strong><span style="font-family: arial, helvetica, sans-serif; font-size: large;">kResolutionShowAll</span></strong></p>
<p><span style="font-family: arial, helvetica, sans-serif; font-size: large;">等比例拉伸，直到宽度或高度达到屏幕的尺寸，但是：如果游戏的设计分辨率比率和设备的屏幕分辨率比率不同，最后会出现黑边。结论：无法使用，黑边出现不符合很多渠道和应用商店的规范。<strong>这个参数说的明白一点就是当我们等比率的扩大和缩小我们的图片资源的时候，最先和屏幕的宽或者是高相匹配后就不再拉伸另一边了，当资源图片的宽高比和设备的宽高比不同时肯定有黑边。</strong></span></p>
<p><strong><span style="font-family: arial, helvetica, sans-serif; font-size: large;">kResolutionExactFit</span></strong></p>
<p><span style="font-family: arial, helvetica, sans-serif; font-size: large;">非等比例拉伸，图像拉伸到整个屏幕。但是：如果游戏的设计分辨率比率和设备的屏幕分辨率比率不同，最后游戏画面失真。结论：可以使用，但是效果很差。</span></p>
<p><strong><span style="font-family: arial, helvetica, sans-serif; font-size: large;">kResolutionNoBorder</span></strong></p>
<p><span style="font-family: arial, helvetica, sans-serif; font-size: large;">等比例拉伸，直到宽度或高度达到屏幕尺寸，且保证在另一方向上不会出现黑边。<strong>就是当我们等比率的扩大和缩小我们的图片资源的时候，当比率小的那一个边和设备的边重合时，比率大的那一个边就出去了，所以虽然不会留下黑边，但是有的图片资源出去了，也许我们写的某一个控件就出去了。</strong></span></p>
<p><span style="font-family: arial, helvetica, sans-serif; font-size: large;">说了这么多其实都是废话，上边的都不是我们的解决方案，因为他们都有弊端。你可以自己试一下，我的代码是这样的，我要通过这个代码来向大家说明几个很难搞清楚的问题。</span></p>
<pre class="brush: cpp; collapse: false; light: false; title: ; toolbar: true; notranslate" title="">
CCSize winSize = CCSize(480,320);

pEGLView-&gt;setDesignResolutionSize(winSize.width, winSize.height, kResolutionShowAll); //appdelegate中这么设置
</pre>
<pre class="brush: cpp; collapse: false; light: false; title: ; toolbar: true; notranslate" title="">
eglView-&gt;setFrameSize(800, 480); //main.cpp中这么设置
</pre>
<p><span style="font-family: arial, helvetica, sans-serif; font-size: large;">如果就是这么设置的话，你会看到这样的现象。</span></p>
<p style="text-align: center;"><a href="http://www.zaojiahua.com/wp-content/uploads/2014/03/2014-03-05_205549.jpg"><img class="size-medium wp-image-635 aligncenter" title="cocos2dx适配方案新解——秒杀所有分辨率" alt="cocos2dx适配方案新解——秒杀所有分辨率" src="http://www.zaojiahua.com/wp-content/uploads/2014/03/2014-03-05_205549-300x193.jpg" data-original="http://www.zaojiahua.com/wp-content/uploads/2014/03/2014-03-05_205549-300x193.jpg" onerror="this.onerror=null;this.src='http://www.zaojiahua.com/wp-content/themes/BYMT/images/images_error.jpg'" width="300" height="193" /></a></p>
<p><span style="font-family: arial, helvetica, sans-serif; font-size: large;">如果你使用的是NoBorder，会有一部分超出我们的视线，但是用这个例子看起来却不容易发现。我们在HelloWorld的init函数中加入以下的调试代码，自己调试一下。</span></p>
<pre class="brush: cpp; collapse: false; light: false; title: ; toolbar: true; notranslate" title="">
 //这里的可视区域的大小是逻辑上的大小，可视区域就是人眼看到的区域在逻辑上的大小
CCSize visibleSize = CCDirector::sharedDirector()-&gt;getVisibleSize();
	//看到的有图画的那个左下角点在逻辑上的位置
    CCPoint origin = CCDirector::sharedDirector()-&gt;getVisibleOrigin();
      //我上边说的逻辑指的就是设计分辨率
	//winSize的大小是设计分辨率的大小，也就是我们appdelegate中写的那个东西
	CCSize winSize = CCDirector::sharedDirector()-&gt;getWinSize();
	//这个获得的是屏幕的大小，是实际设备屏幕的大小
	CCSize glSize = CCEGLView::sharedOpenGLView()-&gt;getFrameSize();
</pre>
<p style="text-align: left;"><a href="http://www.zaojiahua.com/wp-content/uploads/2014/03/2014-03-05_210211.jpg"><img class="size-medium wp-image-637 aligncenter" title="cocos2dx适配方案新解——秒杀所有分辨率" alt="cocos2dx适配方案新解——秒杀所有分辨率" src="http://www.zaojiahua.com/wp-content/uploads/2014/03/2014-03-05_210211-300x151.jpg" data-original="http://www.zaojiahua.com/wp-content/uploads/2014/03/2014-03-05_210211-300x151.jpg" onerror="this.onerror=null;this.src='http://www.zaojiahua.com/wp-content/themes/BYMT/images/images_error.jpg'" width="300" height="151" /></a><a href="http://www.zaojiahua.com/wp-content/uploads/2014/03/2014-03-05_210051.jpg"><img class="size-medium wp-image-636 aligncenter" title="cocos2dx适配方案新解——秒杀所有分辨率" alt="cocos2dx适配方案新解——秒杀所有分辨率" src="http://www.zaojiahua.com/wp-content/uploads/2014/03/2014-03-05_210051-300x67.jpg" data-original="http://www.zaojiahua.com/wp-content/uploads/2014/03/2014-03-05_210051-300x67.jpg" onerror="this.onerror=null;this.src='http://www.zaojiahua.com/wp-content/themes/BYMT/images/images_error.jpg'" width="300" height="67" /></a><span style="font-family: arial, helvetica, sans-serif; font-size: large;">这样的话真的是有一部分超出去了，那几个获得尺寸的函数我注释已经说的很清楚了，所以建议大家以后都使用getVisibleSize()这个函数。而我们想要完成<a href="http://www.zaojiahua.com/tag/%e9%80%82%e9%85%8d" title="查看适配中的全部文章" class="tag_link">适配</a>解决的真正问题就是既让图片都全部显示出来，又不要留下黑边。<strong>也就是说通过getVisibleSize()获得的可视区域的大小和通过getWinSize()获得的逻辑大小是一样的就解决了我们的问题。</strong></span></p>
<p><span style="font-family: arial, helvetica, sans-serif; font-size: large;"><strong>我的方法是当图片的比率和设备分辨率的比率不一样的时候，我们来改变图片的比率，这个比率是设计分辨率的大小，而我们的图片准备的时候就选用和设计分辨率大小差不多的比率。这样俩种比率相同的时候，不论是采用noborder还是showall都是等比率的缩放，都可以达到效果了。</strong>下面看代码吧。</span></p>
<pre class="brush: cpp; collapse: false; light: false; title: ; toolbar: true; notranslate" title="">
//以下是main.cpp文件
int APIENTRY _tWinMain(HINSTANCE hInstance,
                       HINSTANCE hPrevInstance,
                       LPTSTR    lpCmdLine,
                       int       nCmdShow)
{
    UNREFERENCED_PARAMETER(hPrevInstance);
    UNREFERENCED_PARAMETER(lpCmdLine);

    // create the application instance
    AppDelegate app;
    CCEGLView* eglView = CCEGLView::sharedOpenGLView();
    eglView-&gt;setViewName(&quot;resolution&quot;);
	//这个地方就是用来设置实际设备的大小的，常见的手机屏幕分辨率如下：
	/*480X800  现在最主流的中高端安卓智能机的分辨率，包括 windows phone也是这个分辨率
	480X854  这个是WFVGA，是480X800的加长版
	540X960  HTC的高端机很喜欢用这个分辨率也就是qHD了
	640X960 最经典的iphone所使用的分辨率
	1136X640  iphone5的分辨率
	1280X720  传说中的HD，也是现在各品牌主流旗舰机型的分辨率，而且屏幕都很大。
	1280X800  现在只有三星的9220的5.3英寸巨屏用了这以分辨率
	1024x768    iPad1分辨率 iPad2分辨率 iPad mini分辨率
	2048×1536  iPad3分辨率 iPad4分辨率 iPad Air分辨率 iPad mini 2分辨率
	1920x1080 Nexus5分辨率*/
    eglView-&gt;setFrameSize(768, 1024);
	//eglView-&gt;setFrameSize(480,320);
    return CCApplication::sharedApplication()-&gt;run();
}
</pre>
<pre class="brush: cpp; collapse: false; light: false; title: ; toolbar: true; notranslate" title="">
bool AppDelegate::applicationDidFinishLaunching() {
    // initialize director
    CCDirector* pDirector = CCDirector::sharedDirector();
    CCEGLView* pEGLView = CCEGLView::sharedOpenGLView();

    pDirector-&gt;setOpenGLView(pEGLView);

    // turn on display FPS
    pDirector-&gt;setDisplayStats(true);

    // set FPS. the default value is 1.0/60 if you don't call this
    pDirector-&gt;setAnimationInterval(1.0 / 60);

	//以下就是如何进行适配的具体方法
	//getFrameSize()获得实际屏幕的大小
	 CCSize frameSize = pEGLView-&gt;getFrameSize();
	 //这填写的就是一般你作为背景图片的那种图片的大小，适配的原理就是放到和缩小，而以什么为参照，当然就是
	 //以最大的那张图片为参照，什么图片最大，当然是背景图片了，以后美工做图的时候用的就是以下的这个尺寸
	 CCSize winSize=CCSize(480,320);

	 //将宽和高做一个比，通过这个比，来具体的调整逻辑分辨率的大小
	 float widthRate = frameSize.width/winSize.width;
	 float heightRate = frameSize.height/winSize.height;

	 //如果是if中的语句，说明逻辑的高度有点大了，就把逻辑的高缩小到和宽度一样的比率
    if (widthRate &gt; heightRate)
	{
		//里边传入的前俩个参数就是逻辑分辨率的大小，也就是通过getWinSize()得到的大小
		pEGLView-&gt;setDesignResolutionSize(winSize.width,
			winSize.height*heightRate/widthRate, kResolutionNoBorder);
	}
    else
	{
		pEGLView-&gt;setDesignResolutionSize(winSize.width*widthRate/heightRate, winSize.height,
			kResolutionNoBorder);
	}

    // create a scene. it's an autorelease object
    CCScene *pScene = HelloWorld::scene();

    // run
    pDirector-&gt;runWithScene(pScene);

	//pEGLView-&gt;setDesignResolutionSize(480, 320, kResolutionShowAll);

    return true;
}
</pre>
<p><span style="font-family: arial, helvetica, sans-serif; font-size: large;">最后的一个问题就是怎么调用的问题了，<strong>大家记住了，逻辑分辨率的宽和高我们都已经传入到了setDesignResolutionSize()这个函数里，通过getWinSize()这个函数就可以取得，所以大家写代码的时候就用这个函数获取就行了，最后来看看效果。</strong></span></p>
<p style="text-align: center;"><a href="http://www.zaojiahua.com/wp-content/uploads/2014/03/2014-03-05_214131.jpg"><img class="size-medium wp-image-641 aligncenter" title="cocos2dx适配方案新解——秒杀所有分辨率" alt="cocos2dx适配方案新解——秒杀所有分辨率" src="http://www.zaojiahua.com/wp-content/uploads/2014/03/2014-03-05_214131-300x61.jpg" data-original="http://www.zaojiahua.com/wp-content/uploads/2014/03/2014-03-05_214131-300x61.jpg" onerror="this.onerror=null;this.src='http://www.zaojiahua.com/wp-content/themes/BYMT/images/images_error.jpg'" width="300" height="61" /></a> <a href="http://www.zaojiahua.com/wp-content/uploads/2014/03/2014-03-05_214144.jpg"><img class="size-medium wp-image-642 aligncenter" title="cocos2dx适配方案新解——秒杀所有分辨率" alt="cocos2dx适配方案新解——秒杀所有分辨率" src="http://www.zaojiahua.com/wp-content/uploads/2014/03/2014-03-05_214144-300x70.jpg" data-original="http://www.zaojiahua.com/wp-content/uploads/2014/03/2014-03-05_214144-300x70.jpg" onerror="this.onerror=null;this.src='http://www.zaojiahua.com/wp-content/themes/BYMT/images/images_error.jpg'" width="300" height="70" /></a> <a href="http://www.zaojiahua.com/wp-content/uploads/2014/03/2014-03-05_214251.jpg"><img class="size-medium wp-image-643 aligncenter" title="cocos2dx适配方案新解——秒杀所有分辨率" alt="cocos2dx适配方案新解——秒杀所有分辨率" src="http://www.zaojiahua.com/wp-content/uploads/2014/03/2014-03-05_214251-300x191.jpg" data-original="http://www.zaojiahua.com/wp-content/uploads/2014/03/2014-03-05_214251-300x191.jpg" onerror="this.onerror=null;this.src='http://www.zaojiahua.com/wp-content/themes/BYMT/images/images_error.jpg'" width="300" height="191" /></a> <a href="http://www.zaojiahua.com/wp-content/uploads/2014/03/2014-03-05_214401.jpg"><img class="size-medium wp-image-644 aligncenter" title="cocos2dx适配方案新解——秒杀所有分辨率" alt="cocos2dx适配方案新解——秒杀所有分辨率" src="http://www.zaojiahua.com/wp-content/uploads/2014/03/2014-03-05_214401-300x82.jpg" data-original="http://www.zaojiahua.com/wp-content/uploads/2014/03/2014-03-05_214401-300x82.jpg" onerror="this.onerror=null;this.src='http://www.zaojiahua.com/wp-content/themes/BYMT/images/images_error.jpg'" width="300" height="82" /></a> <a href="http://www.zaojiahua.com/wp-content/uploads/2014/03/2014-03-05_214412.jpg"><img class="size-medium wp-image-645 aligncenter" title="cocos2dx适配方案新解——秒杀所有分辨率" alt="cocos2dx适配方案新解——秒杀所有分辨率" src="http://www.zaojiahua.com/wp-content/uploads/2014/03/2014-03-05_214412-300x75.jpg" data-original="http://www.zaojiahua.com/wp-content/uploads/2014/03/2014-03-05_214412-300x75.jpg" onerror="this.onerror=null;this.src='http://www.zaojiahua.com/wp-content/themes/BYMT/images/images_error.jpg'" width="300" height="75" /></a> <a href="http://www.zaojiahua.com/wp-content/uploads/2014/03/2014-03-05_214439.jpg"><img class="size-medium wp-image-646 aligncenter" title="cocos2dx适配方案新解——秒杀所有分辨率" alt="cocos2dx适配方案新解——秒杀所有分辨率" src="http://www.zaojiahua.com/wp-content/uploads/2014/03/2014-03-05_214439-300x178.jpg" data-original="http://www.zaojiahua.com/wp-content/uploads/2014/03/2014-03-05_214439-300x178.jpg" onerror="this.onerror=null;this.src='http://www.zaojiahua.com/wp-content/themes/BYMT/images/images_error.jpg'" width="300" height="178" /></a> <a href="http://www.zaojiahua.com/wp-content/uploads/2014/03/2014-03-05_214747.jpg"><img class="size-medium wp-image-647 aligncenter" title="cocos2dx适配方案新解——秒杀所有分辨率" alt="cocos2dx适配方案新解——秒杀所有分辨率" src="http://www.zaojiahua.com/wp-content/uploads/2014/03/2014-03-05_214747-300x74.jpg" data-original="http://www.zaojiahua.com/wp-content/uploads/2014/03/2014-03-05_214747-300x74.jpg" onerror="this.onerror=null;this.src='http://www.zaojiahua.com/wp-content/themes/BYMT/images/images_error.jpg'" width="300" height="74" /></a> <a href="http://www.zaojiahua.com/wp-content/uploads/2014/03/2014-03-05_214759.jpg"><img class="alignnone size-medium wp-image-648" alt="2014-03-05_214759" src="http://www.zaojiahua.com/wp-content/uploads/2014/03/2014-03-05_214759-300x74.jpg" data-original="http://www.zaojiahua.com/wp-content/uploads/2014/03/2014-03-05_214759-300x74.jpg" onerror="this.onerror=null;this.src='http://www.zaojiahua.com/wp-content/themes/BYMT/images/images_error.jpg'" width="300" height="74" /></a> <a href="http://www.zaojiahua.com/wp-content/uploads/2014/03/2014-03-05_214837.jpg"><img class="size-medium wp-image-649 aligncenter" title="cocos2dx适配方案新解——秒杀所有分辨率" alt="cocos2dx适配方案新解——秒杀所有分辨率" src="http://www.zaojiahua.com/wp-content/uploads/2014/03/2014-03-05_214837-300x283.jpg" data-original="http://www.zaojiahua.com/wp-content/uploads/2014/03/2014-03-05_214837-300x283.jpg" onerror="this.onerror=null;this.src='http://www.zaojiahua.com/wp-content/themes/BYMT/images/images_error.jpg'" width="300" height="283" /></a></p>
<p style="text-align: left;"><span style="font-family: arial, helvetica, sans-serif; font-size: large;">最后一张图片太大了没有截全。<strong>最后给大家一个建议，我们现在的android手机的大部分分辨率都是800*480的，所以大家在做美工的时候背景图片就选择这么大的，然后程序中appdelegate的那个CCSize里边传入的参数也是这个，这样的话就会不错了。最后的最后请养成看文章留言的好习惯，也许我的方法不是最好的，请和我交流！</strong></span></p>
									</div>
                                <div class="post-footer">
                				<div class="post-tagsshare">
                						<div class="post-tags">
						<i class="icon-tags"></i> <a class="tag-link tag-link-95" title="查看更多关于 适配 的内容" href="http://www.zaojiahua.com/tag/%e9%80%82%e9%85%8d" rel="tag">适配</a>					</div>
                                        					<div class="post-share">
						<i class="icon-share"></i> <script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"0","bdSize":"16"},"slide":{"type":"slide","bdImg":"8","bdPos":"right","bdTop":"100"}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</script>					</div>
                    				</div>
                								<div class="post-copyright">
					<div id="author-avatar"><img src="http://www.zaojiahua.com/avatar/e0f9fe96051656cdc2e68f07c97f9d1d-42.jpg" alt="avatar" class="avatar avatar-42 photo" height="42" width="42" /></div>
					<div id="copy-info">
					<span id="copy-arrow"><span></span></span>
																<p><strong>版权声明：</strong>本文由( <a href="http://www.zaojiahua.com/author/admin" title="由小塔发布" rel="author">小塔</a> )原创，转载请保留文章出处！</p>
						<p><strong>本文链接：</strong><a class="copy-link-1" href="http://www.zaojiahua.com/adaptation.html" title=http://www.zaojiahua.com/adaptation.html>http://www.zaojiahua.com/adaptation.html</a></p>
															</div>
										<div class="post-like"><div class="bdlikebutton"></div>
		<script id="bdlike_shell"></script>
		<script>
		var bdShare_config = {
			"type":"large",
			"color":"blue",
			"uid":"590440"
		};
		document.getElementById("bdlike_shell").src="http://bdimg.share.baidu.com/static/js/like_shell.js?t=" + Math.ceil(new Date()/3600000);
		</script></div>
									</div>
				                					<div class="post-related">
	<ul>
				<li>
			<span class="time">01-11</span>
			<span class="title"><i class="icon-doc-text"></i> <a href="http://www.zaojiahua.com/formatted-output.html" title="c++中实现格式化输出">c++中实现格式化输出</a></span>
			<small  class="pcomm"><i class="icon-comment-1"></i> <a href="http://www.zaojiahua.com/formatted-output.html#respond" rel="nofollow" class="ds-thread-count" data-thread-key="1005" title="《c++中实现格式化输出》上的评论">0</a></small>
		</li>
				<li>
			<span class="time">02-27</span>
			<span class="title"><i class="icon-doc-text"></i> <a href="http://www.zaojiahua.com/android-platform.html" title="cocos2dx移植android平台-我的血泪史">cocos2dx移植android平台-我的血泪史</a></span>
			<small  class="pcomm"><i class="icon-comment-1"></i> <a href="http://www.zaojiahua.com/android-platform.html#comments" rel="nofollow" class="ds-thread-count" data-thread-key="427" title="《cocos2dx移植android平台-我的血泪史》上的评论">70</a></small>
		</li>
			</ul>
</div>
												<div class="post-navigation">
					<div class="post-previous">
						<a href="http://www.zaojiahua.com/xml-judge.html" rel="prev"><span>上一篇</span> 用户游戏数据保存之再度探讨-解决XML文件是否存在的判断问题</a>					</div>
					<div class="post-next">
						<a href="http://www.zaojiahua.com/ninja-darts-2.html" rel="next"><span>下一篇</span> Cocos2d-x游戏实例之忍者飞镖——添加其他元素</a>					</div>
				</div>
				                </div>
			<a name="comments"></a>

<div class="ds-thread" data-thread-key="630" data-author-key="1" data-title="cocos2dx适配方案新解——秒杀所有分辨率" data-url="http://www.zaojiahua.com/adaptation.html"></div>

<script type="text/javascript">
	if (typeof DUOSHUO !== 'undefined')
		DUOSHUO.EmbedThread('.ds-thread');
</script>
	<div id="ds-ssr">

		
            <ol id="commentlist">
                		<li class="comment even thread-even depth-1" id="li-comment-33">
			<article id="comment-33" class="comment">
				<footer class="comment-meta">
					<cite class="comment-author vcard">
						<span class="fn"><a href='http://t.qq.com/yjyyagw' rel='external nofollow' class='url'>杨洁</a></span> on <a rel="nofollow" href="http://www.zaojiahua.com/adaptation.html#comment-33"><time pubdate datetime="2014-03-07T11:41:35+00:00">2014年3月7日 at 上午11:41</time></a> <span class="says">said:</span>					</cite><!-- .comment-author .vcard -->
				</footer>
	
				<div class="comment-content"><p>不多哦</p>
</div>
				
			</article><!-- #comment-## -->
		<ul class="children">
		<li class="comment odd alt depth-2" id="li-comment-35">
			<article id="comment-35" class="comment">
				<footer class="comment-meta">
					<cite class="comment-author vcard">
						<span class="fn">小塔</span> on <a rel="nofollow" href="http://www.zaojiahua.com/adaptation.html#comment-35"><time pubdate datetime="2014-03-07T12:08:33+00:00">2014年3月7日 at 下午12:08</time></a> <span class="says">said:</span>					</cite><!-- .comment-author .vcard -->
				</footer>
	
				<div class="comment-content"><p>是不多啊，菜鸟一枚，努力中！</p>
</div>
				
			</article><!-- #comment-## -->
		<ul class="children">
		<li class="comment even depth-3" id="li-comment-53">
			<article id="comment-53" class="comment">
				<footer class="comment-meta">
					<cite class="comment-author vcard">
						<span class="fn"><a href='http://t.qq.com/yjyyagw' rel='external nofollow' class='url'>杨洁</a></span> on <a rel="nofollow" href="http://www.zaojiahua.com/adaptation.html#comment-53"><time pubdate datetime="2014-03-11T08:43:03+00:00">2014年3月11日 at 上午8:43</time></a> <span class="says">said:</span>					</cite><!-- .comment-author .vcard -->
				</footer>
	
				<div class="comment-content"><p>我擦。我打错字了。。。不错打成不多了</p>
</div>
				
			</article><!-- #comment-## -->
		<ul class="children">
		<li class="comment byuser comment-author-admin bypostauthor odd alt depth-4" id="li-comment-57">
			<article id="comment-57" class="comment">
				<footer class="comment-meta">
					<cite class="comment-author vcard">
						<span class="fn"><a href='http://weibo.com/dengta2014' rel='external nofollow' class='url'>小塔</a></span> on <a rel="nofollow" href="http://www.zaojiahua.com/adaptation.html#comment-57"><time pubdate datetime="2014-03-11T22:02:18+00:00">2014年3月11日 at 下午10:02</time></a> <span class="says">said:</span>					</cite><!-- .comment-author .vcard -->
				</footer>
	
				<div class="comment-content"><p>不过真的是不多哦。谢谢你的帮助啊！</p>
</div>
				
			</article><!-- #comment-## -->
		</li><!-- #comment-## -->
</ul><!-- .children -->
</li><!-- #comment-## -->
</ul><!-- .children -->
</li><!-- #comment-## -->
</ul><!-- .children -->
</li><!-- #comment-## -->
		<li class="comment even thread-odd thread-alt depth-1" id="li-comment-34">
			<article id="comment-34" class="comment">
				<footer class="comment-meta">
					<cite class="comment-author vcard">
						<span class="fn"><a href='http://t.qq.com/yjyyagw' rel='external nofollow' class='url'>杨洁</a></span> on <a rel="nofollow" href="http://www.zaojiahua.com/adaptation.html#comment-34"><time pubdate datetime="2014-03-07T11:41:42+00:00">2014年3月7日 at 上午11:41</time></a> <span class="says">said:</span>					</cite><!-- .comment-author .vcard -->
				</footer>
	
				<div class="comment-content"><p>不错哦。。。</p>
</div>
				
			</article><!-- #comment-## -->
		</li><!-- #comment-## -->
		<li class="comment odd alt thread-even depth-1" id="li-comment-81">
			<article id="comment-81" class="comment">
				<footer class="comment-meta">
					<cite class="comment-author vcard">
						<span class="fn"><a href='http://weibo.com/1930345407' rel='external nofollow' class='url'>Oo幻想oO</a></span> on <a rel="nofollow" href="http://www.zaojiahua.com/adaptation.html#comment-81"><time pubdate datetime="2014-03-27T11:24:43+00:00">2014年3月27日 at 上午11:24</time></a> <span class="says">said:</span>					</cite><!-- .comment-author .vcard -->
				</footer>
	
				<div class="comment-content"><p>本来想偷懒不留言的说……表示没看懂，这个做法和使用ExactFit有什么区别呢？你的做法不是也是非等比例拉伸么？</p>
</div>
				
			</article><!-- #comment-## -->
		<ul class="children">
		<li class="comment byuser comment-author-admin bypostauthor even depth-2" id="li-comment-83">
			<article id="comment-83" class="comment">
				<footer class="comment-meta">
					<cite class="comment-author vcard">
						<span class="fn"><a href='http://weibo.com/dengta2014' rel='external nofollow' class='url'>小塔</a></span> on <a rel="nofollow" href="http://www.zaojiahua.com/adaptation.html#comment-83"><time pubdate datetime="2014-03-27T16:38:52+00:00">2014年3月27日 at 下午4:38</time></a> <span class="says">said:</span>					</cite><!-- .comment-author .vcard -->
				</footer>
	
				<div class="comment-content"><p>亲，你好好看看，怎么能是非等比率呢？这个是等比率的拉伸的，所以会有一部分出去的，但是视图大小和逻辑大小是相同的，也就是说只要你放在上边的按钮和其他元素是按照逻辑大小放的，都是可以显示出来的。</p>
</div>
				
			</article><!-- #comment-## -->
		<ul class="children">
		<li class="comment odd alt depth-3" id="li-comment-198">
			<article id="comment-198" class="comment">
				<footer class="comment-meta">
					<cite class="comment-author vcard">
						<span class="fn">o</span> on <a rel="nofollow" href="http://www.zaojiahua.com/adaptation.html#comment-198"><time pubdate datetime="2014-05-01T23:31:50+00:00">2014年5月1日 at 下午11:31</time></a> <span class="says">said:</span>					</cite><!-- .comment-author .vcard -->
				</footer>
	
				<div class="comment-content"><p>现在你修正了逻辑大小，原先设置的逻辑大小已经固定了。所以够呛</p>
</div>
				
			</article><!-- #comment-## -->
		</li><!-- #comment-## -->
</ul><!-- .children -->
</li><!-- #comment-## -->
</ul><!-- .children -->
</li><!-- #comment-## -->
		<li class="comment even thread-odd thread-alt depth-1" id="li-comment-90">
			<article id="comment-90" class="comment">
				<footer class="comment-meta">
					<cite class="comment-author vcard">
						<span class="fn">cocos</span> on <a rel="nofollow" href="http://www.zaojiahua.com/adaptation.html#comment-90"><time pubdate datetime="2014-03-31T16:33:17+00:00">2014年3月31日 at 下午4:33</time></a> <span class="says">said:</span>					</cite><!-- .comment-author .vcard -->
				</footer>
	
				<div class="comment-content"><p>对于cocostuidio已经设置的 size，好像有点问题。不能解决的，同意一楼</p>
</div>
				
			</article><!-- #comment-## -->
		<ul class="children">
		<li class="comment byuser comment-author-admin bypostauthor odd alt depth-2" id="li-comment-91">
			<article id="comment-91" class="comment">
				<footer class="comment-meta">
					<cite class="comment-author vcard">
						<span class="fn"><a href='http://weibo.com/dengta2014' rel='external nofollow' class='url'>小塔</a></span> on <a rel="nofollow" href="http://www.zaojiahua.com/adaptation.html#comment-91"><time pubdate datetime="2014-03-31T16:38:16+00:00">2014年3月31日 at 下午4:38</time></a> <span class="says">said:</span>					</cite><!-- .comment-author .vcard -->
				</footer>
	
				<div class="comment-content"><p>你是说使用cocostudio啊，那图片会根据不同的平台大小缩放吗？应该会把，还是图片出去了？</p>
</div>
				
			</article><!-- #comment-## -->
		</li><!-- #comment-## -->
</ul><!-- .children -->
</li><!-- #comment-## -->
		<li class="comment even thread-even depth-1" id="li-comment-109">
			<article id="comment-109" class="comment">
				<footer class="comment-meta">
					<cite class="comment-author vcard">
						<span class="fn">HelloCocos</span> on <a rel="nofollow" href="http://www.zaojiahua.com/adaptation.html#comment-109"><time pubdate datetime="2014-04-03T11:30:10+00:00">2014年4月3日 at 上午11:30</time></a> <span class="says">said:</span>					</cite><!-- .comment-author .vcard -->
				</footer>
	
				<div class="comment-content"><p>很详细，谢谢了</p>
</div>
				
			</article><!-- #comment-## -->
		<ul class="children">
		<li class="comment byuser comment-author-admin bypostauthor odd alt depth-2" id="li-comment-112">
			<article id="comment-112" class="comment">
				<footer class="comment-meta">
					<cite class="comment-author vcard">
						<span class="fn"><a href='http://weibo.com/dengta2014' rel='external nofollow' class='url'>小塔</a></span> on <a rel="nofollow" href="http://www.zaojiahua.com/adaptation.html#comment-112"><time pubdate datetime="2014-04-03T16:20:26+00:00">2014年4月3日 at 下午4:20</time></a> <span class="says">said:</span>					</cite><!-- .comment-author .vcard -->
				</footer>
	
				<div class="comment-content"><p> &lt;img src=&quot;http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/0b/tootha_org.gif&quot; /&gt; </p>
</div>
				
			</article><!-- #comment-## -->
		</li><!-- #comment-## -->
</ul><!-- .children -->
</li><!-- #comment-## -->
		<li class="comment even thread-odd thread-alt depth-1" id="li-comment-110">
			<article id="comment-110" class="comment">
				<footer class="comment-meta">
					<cite class="comment-author vcard">
						<span class="fn"><a href='http://t.qq.com/dl659257617' rel='external nofollow' class='url'>蝶恋</a></span> on <a rel="nofollow" href="http://www.zaojiahua.com/adaptation.html#comment-110"><time pubdate datetime="2014-04-03T15:59:27+00:00">2014年4月3日 at 下午3:59</time></a> <span class="says">said:</span>					</cite><!-- .comment-author .vcard -->
				</footer>
	
				<div class="comment-content"><p>请问博主是的引擎版本是多少？ 3,0rc里面很多东西都改变了 是不会配置分辨率的方法也不一样了</p>
</div>
				
			</article><!-- #comment-## -->
		<ul class="children">
		<li class="comment byuser comment-author-admin bypostauthor odd alt depth-2" id="li-comment-111">
			<article id="comment-111" class="comment">
				<footer class="comment-meta">
					<cite class="comment-author vcard">
						<span class="fn"><a href='http://weibo.com/dengta2014' rel='external nofollow' class='url'>小塔</a></span> on <a rel="nofollow" href="http://www.zaojiahua.com/adaptation.html#comment-111"><time pubdate datetime="2014-04-03T16:20:16+00:00">2014年4月3日 at 下午4:20</time></a> <span class="says">said:</span>					</cite><!-- .comment-author .vcard -->
				</footer>
	
				<div class="comment-content"><p>我用的是2.2的版本，至于3.0的因为没有接触就不清楚了，不过你自己可以试试啊。</p>
</div>
				
			</article><!-- #comment-## -->
		<ul class="children">
		<li class="comment even depth-3" id="li-comment-113">
			<article id="comment-113" class="comment">
				<footer class="comment-meta">
					<cite class="comment-author vcard">
						<span class="fn"><a href='http://t.qq.com/dl659257617' rel='external nofollow' class='url'>蝶恋</a></span> on <a rel="nofollow" href="http://www.zaojiahua.com/adaptation.html#comment-113"><time pubdate datetime="2014-04-03T16:32:58+00:00">2014年4月3日 at 下午4:32</time></a> <span class="says">said:</span>					</cite><!-- .comment-author .vcard -->
				</footer>
	
				<div class="comment-content"><p>恩  好的 正在尝试处理</p>
</div>
				
			</article><!-- #comment-## -->
		</li><!-- #comment-## -->
</ul><!-- .children -->
</li><!-- #comment-## -->
</ul><!-- .children -->
</li><!-- #comment-## -->
		<li class="comment odd alt thread-even depth-1" id="li-comment-164">
			<article id="comment-164" class="comment">
				<footer class="comment-meta">
					<cite class="comment-author vcard">
						<span class="fn"><a href='http://t.qq.com/lanbo478990160' rel='external nofollow' class='url'>张仰龙</a></span> on <a rel="nofollow" href="http://www.zaojiahua.com/adaptation.html#comment-164"><time pubdate datetime="2014-04-24T17:05:38+00:00">2014年4月24日 at 下午5:05</time></a> <span class="says">said:</span>					</cite><!-- .comment-author .vcard -->
				</footer>
	
				<div class="comment-content"><p>我测试过了，感觉挺好的。顶个，小塔牛B啦 &lt;img src=&quot;http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/0b/tootha_org.gif&quot; /&gt; </p>
</div>
				
			</article><!-- #comment-## -->
		<ul class="children">
		<li class="comment byuser comment-author-admin bypostauthor even depth-2" id="li-comment-166">
			<article id="comment-166" class="comment">
				<footer class="comment-meta">
					<cite class="comment-author vcard">
						<span class="fn"><a href='http://weibo.com/dengta2014' rel='external nofollow' class='url'>小塔</a></span> on <a rel="nofollow" href="http://www.zaojiahua.com/adaptation.html#comment-166"><time pubdate datetime="2014-04-24T18:07:01+00:00">2014年4月24日 at 下午6:07</time></a> <span class="says">said:</span>					</cite><!-- .comment-author .vcard -->
				</footer>
	
				<div class="comment-content"><p>谢谢支持哈，一块进步吧！</p>
</div>
				
			</article><!-- #comment-## -->
		</li><!-- #comment-## -->
</ul><!-- .children -->
</li><!-- #comment-## -->
		<li class="comment odd alt thread-odd thread-alt depth-1" id="li-comment-185">
			<article id="comment-185" class="comment">
				<footer class="comment-meta">
					<cite class="comment-author vcard">
						<span class="fn"><a href='http://t.qq.com/mxs_8023work' rel='external nofollow' class='url'>MXS</a></span> on <a rel="nofollow" href="http://www.zaojiahua.com/adaptation.html#comment-185"><time pubdate datetime="2014-04-27T17:51:46+00:00">2014年4月27日 at 下午5:51</time></a> <span class="says">said:</span>					</cite><!-- .comment-author .vcard -->
				</footer>
	
				<div class="comment-content"><p> &lt;img src=&quot;http://img.t.sinajs.cn/t35/style/images/common/face/ext/normal/af/kl_org.gif&quot; /&gt; </p>
</div>
				
			</article><!-- #comment-## -->
		</li><!-- #comment-## -->
		<li class="comment even thread-even depth-1" id="li-comment-197">
			<article id="comment-197" class="comment">
				<footer class="comment-meta">
					<cite class="comment-author vcard">
						<span class="fn">ddd</span> on <a rel="nofollow" href="http://www.zaojiahua.com/adaptation.html#comment-197"><time pubdate datetime="2014-05-01T23:29:44+00:00">2014年5月1日 at 下午11:29</time></a> <span class="says">said:</span>					</cite><!-- .comment-author .vcard -->
				</footer>
	
				<div class="comment-content"><p>感觉这个是掩耳盗铃的做法。说的 有点过。setDesignResolutionSize(w,h,policy)的作用就是根据w h和framew frameh的关系，按照policy来进行缩放。 现在的做法是先根据frame和原有的设计的大小，修正设计的大小，这样cocos2d的policy就能得到一个较好的缩放因子。 问题是，实际设置的大小，和修正的大小不一样，所以，这个不行呀。可以使用cocostudio弄好界面，来看执行情况，或者现在的图片4边红色描边，不要仅仅看运行后的winsize,不知道说的有没有道理。</p>
</div>
				
			</article><!-- #comment-## -->
		<ul class="children">
		<li class="comment odd alt depth-2" id="li-comment-199">
			<article id="comment-199" class="comment">
				<footer class="comment-meta">
					<cite class="comment-author vcard">
						<span class="fn">ddd</span> on <a rel="nofollow" href="http://www.zaojiahua.com/adaptation.html#comment-199"><time pubdate datetime="2014-05-01T23:43:07+00:00">2014年5月1日 at 下午11:43</time></a> <span class="says">said:</span>					</cite><!-- .comment-author .vcard -->
				</footer>
	
				<div class="comment-content"><p>再加一个说法。原先设计的大小 就是资源的大小，缩放是屏幕大小和资源大小的比来考虑的。</p>
</div>
				
			</article><!-- #comment-## -->
		</li><!-- #comment-## -->
		<li class="comment byuser comment-author-admin bypostauthor even depth-2" id="li-comment-200">
			<article id="comment-200" class="comment">
				<footer class="comment-meta">
					<cite class="comment-author vcard">
						<span class="fn"><a href='http://weibo.com/dengta2014' rel='external nofollow' class='url'>小塔</a></span> on <a rel="nofollow" href="http://www.zaojiahua.com/adaptation.html#comment-200"><time pubdate datetime="2014-05-02T00:04:01+00:00">2014年5月2日 at 上午12:04</time></a> <span class="says">said:</span>					</cite><!-- .comment-author .vcard -->
				</footer>
	
				<div class="comment-content"><p>问题是，实际设置的大小，和修正的大小不一样。这句话怎么说，实际设置的大小和最后的修正的大小是相同的啊。采用这种方法，最后一定是等比率的缩放，资源图片也有可能有一部分是出去的，但是放在里边的元素是不会出去的，我这个试了自己的游戏，但是其他的也没试，可能存在问题，你们是怎么解决的。</p>
</div>
				
			</article><!-- #comment-## -->
		</li><!-- #comment-## -->
</ul><!-- .children -->
</li><!-- #comment-## -->
		<li class="comment odd alt thread-odd thread-alt depth-1" id="li-comment-217">
			<article id="comment-217" class="comment">
				<footer class="comment-meta">
					<cite class="comment-author vcard">
						<span class="fn"><a href='http://weibo.com/3672703163' rel='external nofollow' class='url'>用户mu1h1irw3h</a></span> on <a rel="nofollow" href="http://www.zaojiahua.com/adaptation.html#comment-217"><time pubdate datetime="2014-05-15T16:03:51+00:00">2014年5月15日 at 下午4:03</time></a> <span class="says">said:</span>					</cite><!-- .comment-author .vcard -->
				</footer>
	
				<div class="comment-content"><p>我也新手，不过挺好的</p>
</div>
				
			</article><!-- #comment-## -->
		</li><!-- #comment-## -->
		<li class="comment even thread-even depth-1" id="li-comment-224">
			<article id="comment-224" class="comment">
				<footer class="comment-meta">
					<cite class="comment-author vcard">
						<span class="fn">nbmumu</span> on <a rel="nofollow" href="http://www.zaojiahua.com/adaptation.html#comment-224"><time pubdate datetime="2014-05-19T18:19:53+00:00">2014年5月19日 at 下午6:19</time></a> <span class="says">said:</span>					</cite><!-- .comment-author .vcard -->
				</footer>
	
				<div class="comment-content"><p>版主的方法好像跟这个两种方式差不多：kResolutionFixedHeight和kResolutionFixedWidth是kResolutionNoBorder的进化。</p>
</div>
				
			</article><!-- #comment-## -->
		</li><!-- #comment-## -->
		<li class="comment odd alt thread-odd thread-alt depth-1" id="li-comment-259">
			<article id="comment-259" class="comment">
				<footer class="comment-meta">
					<cite class="comment-author vcard">
						<span class="fn"><a href='http://t.qq.com/tangly-gaga' rel='external nofollow' class='url'>hengxixi</a></span> on <a rel="nofollow" href="http://www.zaojiahua.com/adaptation.html#comment-259"><time pubdate datetime="2014-05-28T14:27:03+00:00">2014年5月28日 at 下午2:27</time></a> <span class="says">said:</span>					</cite><!-- .comment-author .vcard -->
				</footer>
	
				<div class="comment-content"><p>可以</p>
</div>
				
			</article><!-- #comment-## -->
		</li><!-- #comment-## -->
		<li class="comment even thread-even depth-1" id="li-comment-272">
			<article id="comment-272" class="comment">
				<footer class="comment-meta">
					<cite class="comment-author vcard">
						<span class="fn"><a href='http://t.qq.com/vergil9782' rel='external nofollow' class='url'>vergil</a></span> on <a rel="nofollow" href="http://www.zaojiahua.com/adaptation.html#comment-272"><time pubdate datetime="2014-05-31T17:25:31+00:00">2014年5月31日 at 下午5:25</time></a> <span class="says">said:</span>					</cite><!-- .comment-author .vcard -->
				</footer>
	
				<div class="comment-content"><p>顶博主，但还是不明白3个SIZE的区别</p>
</div>
				
			</article><!-- #comment-## -->
		<ul class="children">
		<li class="comment byuser comment-author-admin bypostauthor odd alt depth-2" id="li-comment-274">
			<article id="comment-274" class="comment">
				<footer class="comment-meta">
					<cite class="comment-author vcard">
						<span class="fn"><a href='http://weibo.com/dengta2014' rel='external nofollow' class='url'>小塔</a></span> on <a rel="nofollow" href="http://www.zaojiahua.com/adaptation.html#comment-274"><time pubdate datetime="2014-05-31T19:19:38+00:00">2014年5月31日 at 下午7:19</time></a> <span class="says">said:</span>					</cite><!-- .comment-author .vcard -->
				</footer>
	
				<div class="comment-content"><p>不明白先照着写代码吧，我一直用的这个方法，到目前为止还没发现什么问题。</p>
</div>
				
			</article><!-- #comment-## -->
		</li><!-- #comment-## -->
</ul><!-- .children -->
</li><!-- #comment-## -->
		<li class="comment even thread-odd thread-alt depth-1" id="li-comment-329">
			<article id="comment-329" class="comment">
				<footer class="comment-meta">
					<cite class="comment-author vcard">
						<span class="fn"><a href='http://t.qq.com/txh863242945' rel='external nofollow' class='url'>小马过河</a></span> on <a rel="nofollow" href="http://www.zaojiahua.com/adaptation.html#comment-329"><time pubdate datetime="2014-06-19T16:46:26+00:00">2014年6月19日 at 下午4:46</time></a> <span class="says">said:</span>					</cite><!-- .comment-author .vcard -->
				</footer>
	
				<div class="comment-content"><p>楼主，你这个秒杀所有，我试过，有点不可能，我用的是2.2.3</p>
</div>
				
			</article><!-- #comment-## -->
		</li><!-- #comment-## -->
		<li class="comment odd alt thread-even depth-1" id="li-comment-335">
			<article id="comment-335" class="comment">
				<footer class="comment-meta">
					<cite class="comment-author vcard">
						<span class="fn"><a href='http://t.qq.com/chaoticvirus' rel='external nofollow' class='url'>VvV</a></span> on <a rel="nofollow" href="http://www.zaojiahua.com/adaptation.html#comment-335"><time pubdate datetime="2014-06-24T16:20:22+00:00">2014年6月24日 at 下午4:20</time></a> <span class="says">said:</span>					</cite><!-- .comment-author .vcard -->
				</footer>
	
				<div class="comment-content"><p>不错～～～学习了～</p>
</div>
				
			</article><!-- #comment-## -->
		</li><!-- #comment-## -->
            </ol>

		            
    </div>		</div>
			</div>
	<div id="sidebar">
	<div class="widget" id="widget_tab"><h3 class="tab-title"><span class="selected">最新文章</span><span>热门文章</span><span>手气不错</span></h3>
<div class="tab-content">
        <ul> 
            <li><a href="http://www.zaojiahua.com/defense-programming-model.html" rel="bookmark" title="设计模式——防御式编程模式">设计模式——防御式编程模式</a></li> 
            <li><a href="http://www.zaojiahua.com/skin-mode.html" rel="bookmark" title="设计模式——外观模式">设计模式——外观模式</a></li> 
            <li><a href="http://www.zaojiahua.com/management-mode.html" rel="bookmark" title="设计模式——管理者模式">设计模式——管理者模式</a></li> 
            <li><a href="http://www.zaojiahua.com/factory-pattern.html" rel="bookmark" title="设计模式——工厂模式">设计模式——工厂模式</a></li> 
            <li><a href="http://www.zaojiahua.com/two-stage-build-mode.html" rel="bookmark" title="设计模式——二段构建模式">设计模式——二段构建模式</a></li>        </ul>
        <ul class="hide">
		
<li><a href= "http://www.zaojiahua.com/two-stage-build-mode.html" rel="bookmark" title="设计模式——二段构建模式 (2条评论)" >设计模式——二段构建模式</a></li>
<li><a href= "http://www.zaojiahua.com/score-rankings.html" rel="bookmark" title="用3.0实现飞机大战——分数排行榜的实现 (1条评论)" >用3.0实现飞机大战——分数排行榜的实现</a></li>
<li><a href= "http://www.zaojiahua.com/the-end.html" rel="bookmark" title="用3.0实现飞机大战——终结篇 (1条评论)" >用3.0实现飞机大战——终结篇</a></li>
<li><a href= "http://www.zaojiahua.com/defense-programming-model.html" rel="bookmark" title="设计模式——防御式编程模式 (0条评论)" >设计模式——防御式编程模式</a></li>
<li><a href= "http://www.zaojiahua.com/game-over-scene.html" rel="bookmark" title="用3.0实现飞机大战——游戏结束场景 (0条评论)" >用3.0实现飞机大战——游戏结束场景</a></li>	</ul>
		<ul class="hide"> 
            <li><a href="http://www.zaojiahua.com/cctableview.html" rel="bookmark" title="CCTableView的使用">CCTableView的使用</a></li> 
            <li><a href="http://www.zaojiahua.com/popscene.html" rel="bookmark" title="cocos2dx弹出对话框的实现">cocos2dx弹出对话框的实现</a></li> 
            <li><a href="http://www.zaojiahua.com/adding-a-player.html" rel="bookmark" title="使用3.0实现飞机大战——添加玩家飞机">使用3.0实现飞机大战——添加玩家飞机</a></li> 
            <li><a href="http://www.zaojiahua.com/opening-our-cocos2d-x-tour.html" rel="bookmark" title="从HelloWorld开始，开启我们的cocos2d-x学习之旅">从HelloWorld开始，开启我们的cocos2d-x学习之旅</a></li> 
            <li><a href="http://www.zaojiahua.com/python.html" rel="bookmark" title="使用python创建cocos2d-x工程">使用python创建cocos2d-x工程</a></li>        </ul>
    </div>
</div>
<div class="widget" id="widget_rcomments">	<h3>最新评论</h3>
	<div class="rcomments-content">
	<ul id="rcslider"><li><img src="http://www.zaojiahua.com/avatar/d41d8cd98f00b204e9800998ecf8427e-16.jpg" alt="avatar" class="avatar avatar-16 photo" height="16" width="16" /><span>VvV: </span><a href="http://www.zaojiahua.com/adaptation.html#comment-335" title="查看《cocos2dx适配方案新解——秒杀所有分辨率》上的评论" rel="nofollow">不错～～～学习了～</a></li>
<li><img src="http://www.zaojiahua.com/avatar/7d70e92e191fc2a3500c5ad9f3ae9b7c-16.jpg" alt="avatar" class="avatar avatar-16 photo" height="16" width="16" /><span>123: </span><a href="http://www.zaojiahua.com/android-platform.html#comment-334" title="查看《cocos2dx移植android平台-我的血泪史》上的评论" rel="nofollow">嗨，你后来怎么解决了</a></li>
<li><img src="http://www.zaojiahua.com/avatar/d41d8cd98f00b204e9800998ecf8427e-16.jpg" alt="avatar" class="avatar avatar-16 photo" height="16" width="16" /><span>振: </span><a href="http://www.zaojiahua.com/android-platform.html#comment-333" title="查看《cocos2dx移植android平台-我的血泪史》上的评论" rel="nofollow">楼主QQ多少？多谢楼主，帮我解决了问题</a></li>
<li><img src="http://www.zaojiahua.com/avatar/d41d8cd98f00b204e9800998ecf8427e-16.jpg" alt="avatar" class="avatar avatar-16 photo" height="16" width="16" /><span>铁骑单车: </span><a href="http://www.zaojiahua.com/android-platform.html#comment-332" title="查看《cocos2dx移植android平台-我的血泪史》上的评论" rel="nofollow">楼主第3步那个python.bat批处理文件哪来的？</a></li>
<li><img src="http://www.zaojiahua.com/avatar/d41d8cd98f00b204e9800998ecf8427e-16.jpg" alt="avatar" class="avatar avatar-16 photo" height="16" width="16" /><span>爱在心中: </span><a href="http://www.zaojiahua.com/iconv.html#comment-331" title="查看《cocos2dx使用了第三方库照样移植android平台-解决iconv库的移植问题》上的评论" rel="nofollow">F:/Cocos2d/android-ndk-r9d/toolchains/arm-linux-android&hellip;</a></li>
<li><img src="http://www.zaojiahua.com/avatar/d41d8cd98f00b204e9800998ecf8427e-16.jpg" alt="avatar" class="avatar avatar-16 photo" height="16" width="16" /><span>爱在心中: </span><a href="http://www.zaojiahua.com/android-platform.html#comment-330" title="查看《cocos2dx移植android平台-我的血泪史》上的评论" rel="nofollow">为什么我的是#include "../../../../libiconv/include/iconv.h"报错&hellip;</a></li>
<li><img src="http://www.zaojiahua.com/avatar/d41d8cd98f00b204e9800998ecf8427e-16.jpg" alt="avatar" class="avatar avatar-16 photo" height="16" width="16" /><span>小马过河: </span><a href="http://www.zaojiahua.com/adaptation.html#comment-329" title="查看《cocos2dx适配方案新解——秒杀所有分辨率》上的评论" rel="nofollow">楼主，你这个秒杀所有，我试过，有点不可能，我用的是2.2.3</a></li>
<li><img src="http://www.zaojiahua.com/avatar/3a7a6841b69986e2a136c8e7c819159b-16.jpg" alt="avatar" class="avatar avatar-16 photo" height="16" width="16" /><span>小塔: </span><a href="http://www.zaojiahua.com/socket.html#comment-328" title="查看《socket编程解决网络数据的传输》上的评论" rel="nofollow">当然ok了，测试的时候记住把电脑的防火墙关了。</a></li>
<li><img src="http://www.zaojiahua.com/avatar/d41d8cd98f00b204e9800998ecf8427e-16.jpg" alt="avatar" class="avatar avatar-16 photo" height="16" width="16" /><span>何山: </span><a href="http://www.zaojiahua.com/socket.html#comment-326" title="查看《socket编程解决网络数据的传输》上的评论" rel="nofollow">楼主 在真机上测试成功没？</a></li>
<li><img src="http://www.zaojiahua.com/avatar/d41d8cd98f00b204e9800998ecf8427e-16.jpg" alt="avatar" class="avatar avatar-16 photo" height="16" width="16" /><span>Spring: </span><a href="http://www.zaojiahua.com/memory-management.html#comment-325" title="查看《cocos2dx的内存管理机制》上的评论" rel="nofollow">“”下一帧开始的时候系统又会创建一个内存回收池"这个有点疑问吧，CCAutoreleasePool* CCPo&hellip;</a></li>
</ul>	</div>
</div>
<div class="widget" id="widget_default"><h3>小广告-好书推荐</h3>			<div class="textwidget"><a href="http://redirect.simba.taobao.com/rd?w=unionnojs&amp;f=http%3A%2F%2Fre.taobao.com%2Feauction%3Fe%3DKB%252F%252FdKbQBk0jmraEDZVrLsrOgwlOSKxIAUuPt4hhrd%252BLltG5xFicOSZqewpHPyZzSsmxwdww%252BtdKn4mnluJafsg3%252Be9HZynBKSNKNFUbFOKB3ujUJI0OeA%253D%253D%26ptype%3D100010&amp;k=e2e107a2b72ca1b1&amp;c=un&amp;b=alimm_0&amp;p=mm_50704420_5076050_15858106" target="_blank" rel="http://redirect.simba.taobao.com/rd?w=unionnojs&amp;f=http%3A%2F%2Fre.taobao.com%2Feauction%3Fe%3DKB%252F%252FdKbQBk0jmraEDZVrLsrOgwlOSKxIAUuPt4hhrd%252BLltG5xFicOSZqewpHPyZzSsmxwdww%252BtdKn4mnluJafsg3%252Be9HZynBKSNKNFUbFOKB3ujUJI0OeA%253D%253D%26ptype%3D100010&amp;k=e2e107a2b72ca1b1&amp;c=un&amp;b=alimm_0&amp;p=mm_50704420_5076050_15858106"><img class="alignleft wp-image-1357" title="cocos2d-x官方书" src="http://www.zaojiahua.com/wp-content/uploads/2014/05/2014-05-23_180841-248x300.png" alt="cocos2d-x官方书" width="134" height="162" /></a><a href="http://redirect.simba.taobao.com/rd?w=unionnojs&amp;f=http%3A%2F%2Fre.taobao.com%2Feauction%3Fe%3DozyJJf3H1CsjmraEDZVrLhRLKClbJEO8EUtHUPud5YyLltG5xFicOSZqewpHPyZzSsmxwdww%252BtdKn4mnluJafsg3%252Be9HZynBKSNKNFUbFOKB3ujUJI0OeA%253D%253D%26ptype%3D100010&amp;k=e2e107a2b72ca1b1&amp;c=un&amp;b=alimm_0&amp;p=mm_50704420_5076050_15858106" target="_blank" rel="http://redirect.simba.taobao.com/rd?w=unionnojs&amp;f=http%3A%2F%2Fre.taobao.com%2Feauction%3Fe%3DozyJJf3H1CsjmraEDZVrLhRLKClbJEO8EUtHUPud5YyLltG5xFicOSZqewpHPyZzSsmxwdww%252BtdKn4mnluJafsg3%252Be9HZynBKSNKNFUbFOKB3ujUJI0OeA%253D%253D%26ptype%3D100010&amp;k=e2e107a2b72ca1b1&amp;c=un&amp;b=alimm_0&amp;p=mm_50704420_5076050_15858106"><img class="alignright wp-image-1356" title="himi书cocos2d-x游戏编程" src="http://www.zaojiahua.com/wp-content/uploads/2014/05/2014-05-23_181153-225x300.png" alt="himi书cocos2d-x游戏编程" width="122" height="162" /></a></div>
		</div><div class="widget" id="widget_default"><h3>文章归档</h3>		<ul>
	<li><a href='http://www.zaojiahua.com/2014/06'>2014年六月</a>&nbsp;(7)</li>
	<li><a href='http://www.zaojiahua.com/2014/05'>2014年五月</a>&nbsp;(19)</li>
	<li><a href='http://www.zaojiahua.com/2014/04'>2014年四月</a>&nbsp;(14)</li>
	<li><a href='http://www.zaojiahua.com/2014/03'>2014年三月</a>&nbsp;(22)</li>
	<li><a href='http://www.zaojiahua.com/2014/02'>2014年二月</a>&nbsp;(59)</li>
	<li><a href='http://www.zaojiahua.com/2014/01'>2014年一月</a>&nbsp;(16)</li>
		</ul>
</div>		<div class="widget" id="widget_default"><h3>文章分类</h3>		<ul>
	<li class="cat-item cat-item-5"><a href="http://www.zaojiahua.com/category/c" title="c++基础知识学习">c/c++</a> (26)
</li>
	<li class="cat-item cat-item-1"><a href="http://www.zaojiahua.com/category/cocos2d-x" title="cocos2d-x的基础知识">cocos2d-x基础</a> (65)
</li>
	<li class="cat-item cat-item-3"><a href="http://www.zaojiahua.com/category/cocos2d-xdemo" title="cocos2d-x的实战小案例，旨在加强所学的知识">cocos2d-x实战</a> (26)
</li>
	<li class="cat-item cat-item-99"><a href="http://www.zaojiahua.com/category/java" title="java语言小结">java</a> (8)
</li>
	<li class="cat-item cat-item-26"><a href="http://www.zaojiahua.com/category/download" title="下载专区">下载专区</a> (3)
</li>
	<li class="cat-item cat-item-39"><a href="http://www.zaojiahua.com/category/business" title="资源交易区">交易</a> (3)
</li>
	<li class="cat-item cat-item-66"><a href="http://www.zaojiahua.com/category/other" title="网站的其他分类目录">其他</a> (6)
</li>
	<li class="cat-item cat-item-24"><a href="http://www.zaojiahua.com/category/software-download" title="常用软件下载专区">常用软件下载</a> (1)
</li>
	<li class="cat-item cat-item-4"><a href="http://www.zaojiahua.com/category/suanfa" title="数据结构与算法学习">数据结构与算法</a> (9)
</li>
	<li class="cat-item cat-item-27"><a href="http://www.zaojiahua.com/category/book-download" title="电子书籍下载">电子书籍下载</a> (1)
</li>
	<li class="cat-item cat-item-65"><a href="http://www.zaojiahua.com/category/other-programer" title="c、c++等编程语言">编程语言</a> (34)
</li>
	<li class="cat-item cat-item-36"><a href="http://www.zaojiahua.com/category/video-download" title="视频下载">视频下载</a> (1)
</li>
		</ul>
</div><div class="widget" id="widget_default"><h3>文章关键字</h3><div class="tagcloud"><a href='http://www.zaojiahua.com/tag/3-0%e6%96%b0%e7%89%b9%e6%80%a7' class='tag-link-115' title='5个话题' style='font-size: 15.636363636364pt;'>3.0新特性</a>
<a href='http://www.zaojiahua.com/tag/3-0%e9%a3%9e%e6%9c%ba%e5%a4%a7%e6%88%98' class='tag-link-117' title='14个话题' style='font-size: 22pt;'>3.0飞机大战</a>
<a href='http://www.zaojiahua.com/tag/ccclippingnode' class='tag-link-98' title='2个话题' style='font-size: 10.863636363636pt;'>CCClippingNode</a>
<a href='http://www.zaojiahua.com/tag/cclayer' class='tag-link-21' title='3个话题' style='font-size: 12.772727272727pt;'>CCLayer</a>
<a href='http://www.zaojiahua.com/tag/cocos2d-x-template' class='tag-link-18' title='1个话题' style='font-size: 8pt;'>cocos2d-x模板插件</a>
<a href='http://www.zaojiahua.com/tag/cocos2d-x-document' class='tag-link-20' title='1个话题' style='font-size: 8pt;'>cocos2d-x离线文档</a>
<a href='http://www.zaojiahua.com/tag/helloworld-resolve' class='tag-link-19' title='1个话题' style='font-size: 8pt;'>helloworld解析</a>
<a href='http://www.zaojiahua.com/tag/java%e5%ae%b9%e5%99%a8' class='tag-link-106' title='3个话题' style='font-size: 12.772727272727pt;'>java容器</a>
<a href='http://www.zaojiahua.com/tag/loading%e7%95%8c%e9%9d%a2' class='tag-link-78' title='1个话题' style='font-size: 8pt;'>loading界面</a>
<a href='http://www.zaojiahua.com/tag/schedule%e5%ae%9a%e6%97%b6%e5%99%a8' class='tag-link-37' title='1个话题' style='font-size: 8pt;'>Schedule定时器</a>
<a href='http://www.zaojiahua.com/tag/shell%e7%bc%96%e7%a8%8b' class='tag-link-118' title='3个话题' style='font-size: 12.772727272727pt;'>shell编程</a>
<a href='http://www.zaojiahua.com/tag/tiled%e5%9c%b0%e5%9b%be' class='tag-link-42' title='1个话题' style='font-size: 8pt;'>Tiled地图</a>
<a href='http://www.zaojiahua.com/tag/ui' class='tag-link-23' title='7个话题' style='font-size: 17.545454545455pt;'>UI开发</a>
<a href='http://www.zaojiahua.com/tag/%e5%86%85%e8%81%94%e5%87%bd%e6%95%b0' class='tag-link-83' title='1个话题' style='font-size: 8pt;'>内联函数</a>
<a href='http://www.zaojiahua.com/tag/action' class='tag-link-30' title='1个话题' style='font-size: 8pt;'>动作类</a>
<a href='http://www.zaojiahua.com/tag/%e5%8a%a8%e7%94%bb%e7%b1%bb' class='tag-link-38' title='1个话题' style='font-size: 8pt;'>动画类</a>
<a href='http://www.zaojiahua.com/tag/scene-change' class='tag-link-29' title='1个话题' style='font-size: 8pt;'>场景切换</a>
<a href='http://www.zaojiahua.com/tag/cocos2d-x-coordinate-system' class='tag-link-7' title='1个话题' style='font-size: 8pt;'>坐标体系</a>
<a href='http://www.zaojiahua.com/tag/%e5%ad%a6%e4%b9%a0%e8%a7%86%e9%a2%91' class='tag-link-34' title='1个话题' style='font-size: 8pt;'>学习视频</a>
<a href='http://www.zaojiahua.com/tag/%e5%ae%b9%e5%99%a8' class='tag-link-80' title='4个话题' style='font-size: 14.363636363636pt;'>容器</a>
<a href='http://www.zaojiahua.com/tag/%e5%ae%b9%e5%99%a8%e7%b1%bb' class='tag-link-81' title='1个话题' style='font-size: 8pt;'>容器类</a>
<a href='http://www.zaojiahua.com/tag/%e5%b0%8f%e5%a1%941024' class='tag-link-103' title='9个话题' style='font-size: 19.136363636364pt;'>小塔1024</a>
<a href='http://www.zaojiahua.com/tag/%e5%b1%9e%e6%80%a7%e8%ae%bf%e9%97%ae%e5%99%a8' class='tag-link-82' title='1个话题' style='font-size: 8pt;'>属性访问器</a>
<a href='http://www.zaojiahua.com/tag/%e5%bf%8d%e8%80%85%e9%a3%9e%e9%95%96' class='tag-link-45' title='1个话题' style='font-size: 8pt;'>忍者飞镖</a>
<a href='http://www.zaojiahua.com/tag/controls' class='tag-link-14' title='5个话题' style='font-size: 15.636363636364pt;'>控件类</a>
<a href='http://www.zaojiahua.com/tag/%e6%96%87%e6%9c%ac%e8%be%93%e5%85%a5%e6%a1%86' class='tag-link-76' title='2个话题' style='font-size: 10.863636363636pt;'>文本输入框</a>
<a href='http://www.zaojiahua.com/tag/%e6%97%b6%e9%97%b4' class='tag-link-44' title='1个话题' style='font-size: 8pt;'>时间</a>
<a href='http://www.zaojiahua.com/tag/%e6%9d%ad%e7%94%b5acm' class='tag-link-113' title='5个话题' style='font-size: 15.636363636364pt;'>杭电ACM</a>
<a href='http://www.zaojiahua.com/tag/%e7%82%b9%e4%b9%9d%e5%9b%be' class='tag-link-75' title='1个话题' style='font-size: 8pt;'>点九图</a>
<a href='http://www.zaojiahua.com/tag/environment-to-build' class='tag-link-17' title='1个话题' style='font-size: 8pt;'>环境搭建</a>
<a href='http://www.zaojiahua.com/tag/%e7%94%a8%e6%88%b7%e6%95%b0%e6%8d%ae' class='tag-link-96' title='2个话题' style='font-size: 10.863636363636pt;'>用户数据</a>
<a href='http://www.zaojiahua.com/tag/%e7%a7%bb%e6%a4%8dandroid%e5%b9%b3%e5%8f%b0' class='tag-link-46' title='1个话题' style='font-size: 8pt;'>移植android平台</a>
<a href='http://www.zaojiahua.com/tag/%e7%b1%bb%e5%9f%ba%e7%a1%80' class='tag-link-84' title='2个话题' style='font-size: 10.863636363636pt;'>类基础</a>
<a href='http://www.zaojiahua.com/tag/%e7%b2%be%e7%81%b5%e6%8b%96%e6%8b%bd' class='tag-link-79' title='1个话题' style='font-size: 8pt;'>精灵拖拽</a>
<a href='http://www.zaojiahua.com/tag/%e7%bc%96%e7%a8%8b%e4%b9%a6%e7%b1%8d' class='tag-link-35' title='1个话题' style='font-size: 8pt;'>编程书籍</a>
<a href='http://www.zaojiahua.com/tag/menu-class' class='tag-link-28' title='1个话题' style='font-size: 8pt;'>菜单类</a>
<a href='http://www.zaojiahua.com/tag/%e8%a7%a6%e6%91%b8' class='tag-link-41' title='1个话题' style='font-size: 8pt;'>触摸</a>
<a href='http://www.zaojiahua.com/tag/%e8%ae%be%e8%ae%a1%e6%a8%a1%e5%bc%8f' class='tag-link-119' title='7个话题' style='font-size: 17.545454545455pt;'>设计模式</a>
<a href='http://www.zaojiahua.com/tag/%e8%b5%84%e6%ba%90%e4%ba%a4%e6%98%93' class='tag-link-40' title='2个话题' style='font-size: 10.863636363636pt;'>资源交易</a>
<a href='http://www.zaojiahua.com/tag/software-downloads' class='tag-link-25' title='1个话题' style='font-size: 8pt;'>软件下载专区</a>
<a href='http://www.zaojiahua.com/tag/%e8%be%93%e5%85%a5%e8%be%93%e5%87%ba%e6%b5%81' class='tag-link-74' title='3个话题' style='font-size: 12.772727272727pt;'>输入输出流</a>
<a href='http://www.zaojiahua.com/tag/%e8%bf%9b%e5%ba%a6%e6%9d%a1' class='tag-link-77' title='2个话题' style='font-size: 10.863636363636pt;'>进度条</a>
<a href='http://www.zaojiahua.com/tag/%e9%9a%8f%e6%9c%ba%e6%95%b0' class='tag-link-43' title='1个话题' style='font-size: 8pt;'>随机数</a>
<a href='http://www.zaojiahua.com/tag/default-coordinate' class='tag-link-31' title='1个话题' style='font-size: 8pt;'>默认坐标</a>
<a href='http://www.zaojiahua.com/tag/default-anchor' class='tag-link-32' title='1个话题' style='font-size: 8pt;'>默认锚点</a></div>
</div><div class="widget" id="widget_default"><h3>小塔网站建设-域名和空间</h3>			<div class="textwidget"><p><span style="font-family: arial,helvetica,sans-serif; font-size: large;"><a href="http://www.zaojiahua.com/wp-content/uploads/2014/04/setup.jpg"><img class="size-medium wp-image-983 alignleft" title="想做网站可以找小塔啊！" src="http://www.zaojiahua.com/wp-content/uploads/2014/04/setup-300x292.jpg" alt="想做网站可以找小塔啊！" width="300" height="292" data-pinit="registered" /></a></span></p>
<p><a href="http://www.zaojiahua.com/trading-resources-website.html" target="_blank"><span style="font-family: arial,helvetica,sans-serif; font-size: large;">亲，我的网站做的是不是很漂亮，有需要做网站的可以联系我，本人出售空间和技术！</span></a></p>
</div>
		</div>	</div>
</div>
<div id="footer" class="container">
	<div class="copyright">
				© 2014 <a href="/">皂荚花</a> | 站长统计<script type="text/javascript">var cnzz_protocol = (("https:" == document.location.protocol) ? " https://" : " http://");document.write(unescape("%3Cspan id='cnzz_stat_icon_1000267565'%3E%3C/span%3E%3Cscript src='" + cnzz_protocol + "s96.cnzz.com/z_stat.php%3Fid%3D1000267565%26show%3Dpic' type='text/javascript'%3E%3C/script%3E"));</script>	</div>
		<div class="themeauthor">Powered by <a href="http://zaojiahua.com" target="_blank" rel="license"><strong>小塔</strong></a> </div>
		<div style="display:none">
			<script type="text/javascript">var cnzz_protocol = (("https:" == document.location.protocol) ? " https://" : " http://");document.write(unescape("%3Cspan id='cnzz_stat_icon_1000267565'%3E%3C/span%3E%3Cscript src='" + cnzz_protocol + "s96.cnzz.com/z_stat.php%3Fid%3D1000267565%26show%3Dpic' type='text/javascript'%3E%3C/script%3E"));</script>    	</div>
</div>
<div id="circle"></div>
<div id="circletext">加载中</div>
<div id="circle1"></div>
<div id="backtop"></div>
</div>
</div>
<script type='text/javascript' src='http://www.zaojiahua.com/wp-content/plugins/syntaxhighlighter/syntaxhighlighter2/scripts/shCore.js?ver=2.1.364'></script>
<script type='text/javascript' src='http://www.zaojiahua.com/wp-content/plugins/syntaxhighlighter/syntaxhighlighter2/scripts/shBrushCpp.js?ver=2.1.364'></script>
<script type='text/javascript'>
	(function(){
		var corecss = document.createElement('link');
		var themecss = document.createElement('link');
		var corecssurl = "http://www.zaojiahua.com/wp-content/plugins/syntaxhighlighter/syntaxhighlighter2/styles/shCore.css?ver=2.1.364";
		if ( corecss.setAttribute ) {
				corecss.setAttribute( "rel", "stylesheet" );
				corecss.setAttribute( "type", "text/css" );
				corecss.setAttribute( "href", corecssurl );
		} else {
				corecss.rel = "stylesheet";
				corecss.href = corecssurl;
		}
		document.getElementsByTagName("head")[0].insertBefore( corecss, document.getElementById("syntaxhighlighteranchor") );
		var themecssurl = "http://www.zaojiahua.com/wp-content/plugins/syntaxhighlighter/syntaxhighlighter2/styles/shThemeDefault.css?ver=2.1.364";
		if ( themecss.setAttribute ) {
				themecss.setAttribute( "rel", "stylesheet" );
				themecss.setAttribute( "type", "text/css" );
				themecss.setAttribute( "href", themecssurl );
		} else {
				themecss.rel = "stylesheet";
				themecss.href = themecssurl;
		}
		//document.getElementById("syntaxhighlighteranchor").appendChild(themecss);
		document.getElementsByTagName("head")[0].insertBefore( themecss, document.getElementById("syntaxhighlighteranchor") );
	})();
	SyntaxHighlighter.config.clipboardSwf = 'http://www.zaojiahua.com/wp-content/plugins/syntaxhighlighter/syntaxhighlighter2/scripts/clipboard.swf';
	SyntaxHighlighter.config.strings.expandSource = 'show source';
	SyntaxHighlighter.config.strings.viewSource = '查看源代码';
	SyntaxHighlighter.config.strings.copyToClipboard = '复制到剪贴板';
	SyntaxHighlighter.config.strings.copyToClipboardConfirmation = '代码现在在你的剪贴板';
	SyntaxHighlighter.config.strings.print = '打印';
	SyntaxHighlighter.config.strings.help = '帮助';
	SyntaxHighlighter.config.strings.alert = 'SyntaxHighlighter\n\n';
	SyntaxHighlighter.config.strings.noBrush = '无法找到Brush：';
	SyntaxHighlighter.config.strings.brushNotHtmlScript = 'Brush不能设置 html-script选项';
	SyntaxHighlighter.defaults['collapse'] = true;
	SyntaxHighlighter.defaults['light'] = true;
	SyntaxHighlighter.defaults['pad-line-numbers'] = false;
	SyntaxHighlighter.all();
</script>
<script type='text/javascript' src='http://www.zaojiahua.com/wp-content/themes/BYMT/js/global.min.js?ver=2.1.1'></script>
<script type='text/javascript' src='http://www.zaojiahua.com/wp-content/themes/BYMT/js/lazyload.min.js?ver=2.1.1'></script>
<script type='text/javascript' src='http://www.zaojiahua.com/wp-content/themes/BYMT/js/comments.min.js?ver=2.1.1'></script>
<script type='text/javascript' src='http://www.zaojiahua.com/wp-content/themes/BYMT/js/lightbox.min.js?ver=2.1.1'></script>
</body>
</html>